package com.example.gradle_test_css.server.serverImpl;

import com.example.gradle_test_css.Entity.Menutable;
import com.example.gradle_test_css.repository.MenutableRepository;
import com.example.gradle_test_css.server.MenuTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuTableServerImpl implements MenuTableServer {

    @Autowired
    MenutableRepository menutableRepository;

    @Override
    public List<Menutable> menutableList() {
        return menutableRepository.menulist();
    }

    @Override
    public List<Menutable> menulist() {
        List<Menutable> byParentIdIsNull = menutableRepository.findByParentIdIsNull();
        return byParentIdIsNull;
    }


}
